import {Pipe, PipeTransform} from "@angular/core";
/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'timePeriodType'})
export class TimePeriodType implements PipeTransform {
    transform(value: any): string {
        let result: string = "-";
        for (let type of this.types) {
            if (type.value == value) {
                return type.name;
            }
        }
        return "未知"
    }


    types: any = [
        {name: "每月", value: "month"},
        {name: "每周", value: "week"},
        {name: "每天", value: "day"}
    ]


    getTypes(): any {
        return this.types
    }
}